package org.lx.nursing.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.lx.nursing.domain.CheckInConfig;
import org.lx.nursing.mapper.CheckInConfigMapper;
import org.lx.nursing.service.ICheckInConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * 入住配置Service业务层处理
 *
 * @author lx
 * @date 2025-02-28
 */
@Service
public class CheckInConfigServiceImpl extends ServiceImpl<CheckInConfigMapper, CheckInConfig> implements ICheckInConfigService {
    @Autowired
    private CheckInConfigMapper checkInConfigMapper;

    @Override
    public CheckInConfig selectCheckInConfigById(Long id) {
        return getById(id);
    }

    @Override
    public List<CheckInConfig> selectCheckInConfigList(CheckInConfig checkInConfig) {
        return checkInConfigMapper.selectCheckInConfigList(checkInConfig);
    }

    @Override
    public int insertCheckInConfig(CheckInConfig checkInConfig) {
        return save(checkInConfig) ? 1 : 0;
    }

    @Override
    public int updateCheckInConfig(CheckInConfig checkInConfig) {
        return updateById(checkInConfig) ? 1 : 0;
    }

    @Override
    public int deleteCheckInConfigByIds(Long[] ids) {
        return removeByIds(Arrays.asList(ids)) ? 1 : 0;
    }

    @Override
    public int deleteCheckInConfigById(Long id) {
        return removeById(id) ? 1 : 0;
    }
}
